<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>style</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        #outer{
            width: 500px;
            height: 500px;
            padding: 10px;
            border: 20px solid gray;
            background-color: blue;
            position:relative;
        }
        #inner{
            width: 400px;
            height: 400px;
            padding: 10px;
            border: 20px solid rgb(0, 0, 0);
            background-color: green;
            position:relative;
        }
        #content{
            width: 300px;
            height: 300px;
            padding: 10px;
            border: 20px solid red;
            background-color: yellow;
        }
    </style>
    <script>
        window.onload=function(){
            var outer = document.getElementById("content");
            console.log(outer.offsetLeft);
        }
        
    </script>
</head>
<body>
    <div id="outer">
        <div id="inner">
            <div id="content">

            </div>
        </div>
    </div>
</body>
</html>